<template>
  <div style="padding: 10px">
    <div style="margin: 10px 0">
      <el-button type="primary" @click="add">新资产入库</el-button>
      <el-button type="primary" @click="resend">IT资产调拨</el-button>
    </div>
    <div>
      <div>
        <el-dialog title="新资产入库" v-model="dialogGoodsFormVisible">
          <el-form
            ref="goodsForm"
            :model="goodsForm"
            :rules="rules"
            label-width="120px"
          >
            <el-form-item label="固定资产编码" prop="code">
              <el-input v-model="goodsForm.code" style="width: 60%">
                <!-- <template #prepend value>GM-</template> -->
              </el-input>
              <!-- <el-button @click = "txt">cccc</el-button> -->
            </el-form-item>
            <el-form-item label="设备名称" prop="name">
              <el-input v-model="goodsForm.name" style="width: 60%"></el-input>
            </el-form-item>
            <el-form-item label="品牌型号" prop="type">
              <el-input v-model="goodsForm.type" style="width: 60%"></el-input>
            </el-form-item>
            <el-form-item label="使用人" prop="whichstaff">
              <el-input
                v-model="goodsForm.whichstaff"
                style="width: 60%"
                disabled
              ></el-input>
            </el-form-item>
            <el-form-item label="备注">
              <el-input v-model="goodsForm.ps" style="width: 60%"></el-input>
            </el-form-item>

            <el-form-item label="入库类型">
              <el-radio-group v-model="goodsForm.whichstore">
                <el-radio label="IT资产新设备库"></el-radio>
                <el-radio label="IT资产旧设备库"></el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="RFID条码" prop="rfid">
              <el-button type="primary" @click="bind"> 扫码绑定 </el-button>
              <el-dialog title="新资产入库" v-model="dialogBindFormVisible">
                <el-input
                  v-model="goodsForm.rfid"
                  ref="input"
                  style="width: 60%"
                  @keyup.enter.native="save('goodsForm')"
                ></el-input>
              </el-dialog>
            </el-form-item>
          </el-form>

          <template #footer>
            <span class="dialog-footer">
              <el-button @click="dialogGoodsFormVisible = false"
                >取 消</el-button
              >
              <el-button @click="resetForm('goodsForm')">重置</el-button>
              <el-button type="primary" @click="save('goodsForm')"
                >确 定</el-button
              >
            </span>
          </template>
        </el-dialog>
      </div>
    </div>
  </div>
</template>

<script>
import request from "../utils/request";
export default {
  data() {
    return {
        dialogGoodsFormVisible:true,
        goodsForm:{}
    }
  },
  methods: {
    text() {
      request.get("/api/goods/change-username").then((res) => {
        console.log(res);
        console.log(0.1 + 0.2);
      });
    },
  },
};
</script>
